<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

class BaseCommand extends Command
{

    protected $rootPath;

    public function __construct()
    {
        parent::__construct();
        $this->rootPath = dirname(dirname(dirname(__DIR__)));
    }

    public function runLog($content,$isExit = false) {
        if (is_array($content)) {
            $content = json_encode($content,JSON_UNESCAPED_UNICODE);
        }
        echo "[ ".date("Y-m-d H:i:s")." ] {$content}".PHP_EOL;
        if ($isExit) {
            exit(0);
        }
    }
}